<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>人力资源绩效评估管理</title>
<%@ include file="../../common/Style.jsp"%>
<script>
$(document).ready(function(){
	parent.$.messager.progress('close'); 
	$('#dataGrid').treegrid({
		url : 'hrEvalJSON!selectChainStoreUsers',
		idField: 'id',
		treeField : 'name',
		lines : true,
		onLoadSuccess : function(row, param){
			$.messager.progress('close'); 
		},columns : [ [
			{field:'name', width:230,title:'名称'},
			{field:'parentStoreName', width:230,title:'父级店铺'},
			{field:'status', width:130,title:'店铺状态'},
			{field:'roles', width:180,title:'角色'},
			{field:'password', width:180,title:'密码'},{				
				field : 'action',
				title : '重置密码',
				width : 70,
				align: 'center',
			formatter : function(value, row, index) {
				var str = '';
				if(row.roles != ""){
					str += $.formatString('<a href="#" onclick="resetPassWord(\'{0}\');"><img border="0" src="{1}" /></a>', row.id, '<%=request.getContextPath()%>/conf_files/easyUI/themes/icons/reset.png');
				}			
				return str;
			}
		},{				
			field : 'action1',
			title : '一键登录',
			width : 70,
			align: 'center',
		formatter : function(value, row, index) {
			var str = '';
			if(row.roles != ""){
				str += $.formatString('<a href="#" onclick="oneKeyLogin();"><img border="0" src="{0}" /></a>', '<%=request.getContextPath()%>/conf_files/easyUI/themes/icons/oneKeyLogin.png');
			}			
			return str;
		}
	}
			]]
		});
});


function resetPassWord(userId){
	var params = "chainUserInfor.user_id="+userId
	$.post("hrEvalJSON!resetChainUserPassWord",params, resetBKProcess,"json");	

}

function resetBKProcess(data){
	var returnCode = data.returnCode;
	if (returnCode != SUCCESS)
		$.messager.alert('失败信息', data.message,'error');
	else {
		$.messager.alert('提示', data.message,'info');		
		$("#dataGrid").datagrid('reload');
	}		
}

function oneKeyLogin(){
	$.messager.alert('提示','暂未完成','warning');
}

</script>
</head>
<body>
<div class="easyui-layout" data-options="fit : true,border : false">
	<div data-options="region:'north',border:false" style="height: 65px;">
	<s:form id="userForm" name="userForm"
		theme="simple" method="POST">
		<table width="98%" align="center" class="OuterTable">
			<tr>
				<td>
					<table width="100%" border="0">
						<tr>
							<td height="31" colspan="7">
								<table width="100%" border="0">
									<tr class="PBAOuterTableTitale">
										<td height="31" colspan=3">千禧店铺人员信息:									
										</td>
									</tr>

								
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		</s:form>
	</div>
	
	<div data-options="region:'center',border:false">
		<table id="dataGrid" >
		</table>
			<div id="toolbar" style="display: none;">
				<a onclick="selectUserInfo();" href="javascript:void(0);"
					class="easyui-linkbutton"
					data-options="iconCls:'icon-search',plain:true">查询</a> 
				
			</div>
			 
		</div>
</div>
</body>
</html>